import { IssueReport } from "./Defects";

export type Range = [number, number];

export class FixInfo {
    fixed?: boolean = false;
}

// Ide传过来的选中修复
export interface FixKey {
    filePath: string;
    fixKey: string;
}

// eslint修复信息
export class RuleFix extends FixInfo {
    /**
     * 被修复字符串的起始位置
     */
    range: Range;
    /**
     * 要替换的文本
     */
    text: string;
}

// homecheck的修复信息
export class FunctionFix extends FixInfo {
    /**
     * 修复方法,入参为ArkFile和fixkey
     */
    fix: Function;
}

// AI修复的信息
export class AIFix extends FixInfo {
    /**
     * 提供给大模型的修复语义
     */
    text: string[];
}

export interface FixResult {
    remainIssues: IssueReport[];
    output: string;
    outpath: string;
}

export enum FixMode {
    AST,
    ARKFILE,
    AI,
    UNKNOWN
}